import java.util.Scanner;
import java.lang.Math;

public class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = 999;

        for (int i = 100; i <= n; i++) {
            int num = i;
            int sum = 0;
            while (num != 0) {
                sum += (int) Math.pow(num % 10, 3);
                num /= 10;
            }
            if (sum == i) {
                System.out.println(i);
            }
        }
    }
}
